<?php
// +----------------------------------------------------------------------
// | 麦沃德科技赋能开发者，助力中小企业发展 
// +----------------------------------------------------------------------
// | Copyright (c) 2017～2024  www.wdadmin.cn    All rights reserved.
// +----------------------------------------------------------------------
// | Wdadmin系统产品软件并不是自由软件，不加密，并不代表开源，未经许可不可自由转售和商用
// +----------------------------------------------------------------------
// | Author: MY WORLD Team <bd@maiwd.cn>   www.wdadmin.cn
// +----------------------------------------------------------------------

namespace app\admin\validate\wddj\operationt;

use think\Validate;

class MileageFee extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
        'end_time'=>'require|checkTime',
    ];
    /**
     * 提示消息
     */
    protected $message = [
    ];
    /**
     * 验证场景
     */
    protected $scene = [
        'add'  => ['end_time'],
        'edit' => ['end_time'],
    ];

    protected function checkTime($value,$rule,$data)
    {
        if ($data['start_time'] >= $value) {
            return '开始时间不能大于结束时间';
        }
        return true;
    }
    
}
